﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Data;
using System.Data.SqlClient;

namespace SSMS
{
    class DB
    {
        //类的成员变量
        //类的属性
        private static SqlConnection myCon;
        //将变量myCon封装到属性
        public static SqlConnection MyCon
        {
            //定义属性MyCon的读访问器
            get
            {
                string strCon = "server=192.168.118.188;database=AIS20171127112454;uid=sa;pwd=GFDhzl705;";//外网 正在用
                //string strCon = "server=192.168.1.125;database=AIS20171127112454;uid=sa;pwd=06323317975;"; //内网
                //string strCon = "server=.;database=AIS20171127112454;uid=sa;pwd=123456;"; //测试
                               
                //string strCon = "server=192.168.8.200;database=AIS20171127112454;uid=sa;pwd=06323317975;";
                
                myCon = new SqlConnection(strCon);
                //myCon.Open();
                return myCon;
            }
        }
    }
}
